import axios from 'axios'
import Cookies from 'js-cookie'
import {URL} from './url'

const service = axios.create({
    baseURL:URL + 'api/',
    timeout:5000,
    headers: {},
});

service.interceptors.request.use((config) =>{
    Object.assign(config.headers,{Authorization: `Bearer ${Cookies.get('token')}`});
    return config;
}),(error) => {
    return Promise.reject(error)
}

export default service;